package com.android.lightcontroler;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteDatabase.CursorFactory;
import android.database.sqlite.SQLiteOpenHelper;

public class LightDataHelper extends SQLiteOpenHelper {

	public static final String DB_NAME = "super_light.db";
	public static final String TABLE_NAME = "super_light";
	public static final String COL_ADDRESS = "address";
	public static final String COL_NAME = "name";
	public static final String COL_ID = "_id";

	public LightDataHelper(Context context) {
		super(context, DB_NAME, null, 1);
	}

	public LightDataHelper(Context context, String name, CursorFactory factory,
			int version) {
		super(context, name, factory, version);
		// TODO Auto-generated constructor stub
	}

	@Override
	public void onCreate(SQLiteDatabase db) {
		// TODO Auto-generated method stub
		StringBuffer sb = new StringBuffer();
		sb.append("CREATE TABLE ");
		sb.append(TABLE_NAME);
		sb.append("(");
		sb.append(COL_ID);
		sb.append(" integer primary key autoincrement, ");
		sb.append(COL_ADDRESS);
		sb.append(" varchar(100), ");
		sb.append(COL_NAME);
		sb.append(" TEXT);");

		db.execSQL(sb.toString());
	}

	@Override
	public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
		// TODO Auto-generated method stub

	}

}